import {JobConstants, JobName, RoleConstants} from "@/data/constants/Constants";
import {IconUrl} from "@/data/constants/IconsUrl";
import type {Job} from "@/data/entity/Job";

const jobNameMap = new Map<number, string>(JobName)

export const jobs = new Map<number, Job>([
    [undefined , {id:JobConstants.NONE, name:getJobName(JobConstants.NONE), abbr: 'NONE', role:RoleConstants.NONE, iconUrl: IconUrl.job.NONE}],

    [JobConstants.NONE , {id:JobConstants.NONE, name:getJobName(JobConstants.NONE), abbr: 'NONE', role:RoleConstants.NONE, iconUrl: IconUrl.job.NONE}],

    [JobConstants.AST, {id:JobConstants.AST, name:getJobName(JobConstants.AST), abbr: 'AST', role:RoleConstants.H, iconUrl:IconUrl.job.AST}],
    [JobConstants.WHM, {id:JobConstants.WHM, name:getJobName(JobConstants.WHM), abbr: 'WHM', role:RoleConstants.H, iconUrl:IconUrl.job.WHM}],
    [JobConstants.SGE, {id:JobConstants.SGE, name:getJobName(JobConstants.SGE), abbr: 'SGE', role:RoleConstants.H, iconUrl:IconUrl.job.SGE}],
    [JobConstants.SCH, {id:JobConstants.SCH, name:getJobName(JobConstants.SCH), abbr: 'SCH', role:RoleConstants.H, iconUrl:IconUrl.job.SCH}],

    [JobConstants.PLD, {id:JobConstants.PLD, name:getJobName(JobConstants.PLD), abbr: 'PLD', role:RoleConstants.T, iconUrl:IconUrl.job.PLD}],
    [JobConstants.WAR, {id:JobConstants.WAR, name:getJobName(JobConstants.WAR), abbr: 'WAR', role:RoleConstants.T, iconUrl:IconUrl.job.WAR}],
    [JobConstants.DRK, {id:JobConstants.DRK, name:getJobName(JobConstants.DRK), abbr: 'DRK', role:RoleConstants.T, iconUrl:IconUrl.job.DRK}],
    [JobConstants.GNB, {id:JobConstants.GNB, name:getJobName(JobConstants.GNB), abbr: 'GNB', role:RoleConstants.T, iconUrl:IconUrl.job.GNB}],

    [JobConstants.MNK, {id:JobConstants.MNK, name:getJobName(JobConstants.MNK), abbr: 'MNK', role:RoleConstants.D, iconUrl:IconUrl.job.MNK}],
    [JobConstants.DRG, {id:JobConstants.DRG, name:getJobName(JobConstants.DRG), abbr: 'DRG', role:RoleConstants.D, iconUrl:IconUrl.job.DRG}],
    [JobConstants.NIN, {id:JobConstants.NIN, name:getJobName(JobConstants.NIN), abbr: 'NIN', role:RoleConstants.D, iconUrl:IconUrl.job.NIN}],
    [JobConstants.SAM, {id:JobConstants.SAM, name:getJobName(JobConstants.SAM), abbr: 'SAM', role:RoleConstants.D, iconUrl:IconUrl.job.SAM}],
    [JobConstants.RPR, {id:JobConstants.RPR, name:getJobName(JobConstants.RPR), abbr: 'RPR', role:RoleConstants.D, iconUrl:IconUrl.job.RPR}],

    [JobConstants.BRD, {id:JobConstants.BRD, name:getJobName(JobConstants.BRD), abbr: 'BRD', role:RoleConstants.D, iconUrl:IconUrl.job.BRD}],
    [JobConstants.MCH, {id:JobConstants.MCH, name:getJobName(JobConstants.MCH), abbr: 'MCH', role:RoleConstants.D, iconUrl:IconUrl.job.MCH}],
    [JobConstants.DNC, {id:JobConstants.DNC, name:getJobName(JobConstants.DNC), abbr: 'DNC', role:RoleConstants.D, iconUrl:IconUrl.job.DNC}],

    [JobConstants.BLM, {id:JobConstants.BLM, name:getJobName(JobConstants.BLM), abbr: 'BLM', role:RoleConstants.D, iconUrl:IconUrl.job.BLM}],
    [JobConstants.SMN, {id:JobConstants.SMN, name:getJobName(JobConstants.SMN), abbr: 'SMN', role:RoleConstants.D, iconUrl:IconUrl.job.SMN}],
    [JobConstants.RDM, {id:JobConstants.RDM, name:getJobName(JobConstants.RDM), abbr: 'RDM', role:RoleConstants.D, iconUrl:IconUrl.job.RDM}],
])

function getJobName(jobCode:number):string{
    return jobNameMap.get(jobCode)||'未知'
}

